/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  Platform,
  StyleSheet,
  Text,
  View
} from 'react-native';
import TabBar from 'antd-mobile/lib/tab-bar'
import Home from './app/home/home'
import Recom from './app/recom/recom'
import Find from './app/find/find'
import Mine from './app/mine/mine'

export default class App extends Component {

  constructor(props) {
    super(props);
    this.state = {
      selectedTab: '首页',
      fullScreen: false,
    };
  }

  render() {
    return (
      <View style={{flex: 1}}>
        <TabBar
          unselectedTintColor="#949494"
          tintColor="#33A3F4"
          barTintColor="white"
        >
        <TabBar.Item
            title="首页"
            key="home"
            icon={require('./img/cry.png')}
            selectedIcon={require('./img/Smile.png')}
            selected={this.state.selectedTab === '首页'}
            onPress={() => {
              this.setState({
                selectedTab: '首页',
              });
            }}
          >
          <Home />
          </TabBar.Item>
          <TabBar.Item
            title="推荐"
            key="recommended"
            icon={require('./img/cry.png')}
            selectedIcon={require('./img/Smile.png')}
            selected={this.state.selectedTab === '推荐'}
            onPress={() => {
              this.setState({
                selectedTab: '推荐',
              });
            }}
          >
          <Recom />
          </TabBar.Item>
          <TabBar.Item
            title="发现"
            key="find"
            icon={require('./img/cry.png')}
            selectedIcon={require('./img/Smile.png')}
            selected={this.state.selectedTab === '发现'}
            onPress={() => {
              this.setState({
                selectedTab: '发现',
              });
            }}
          >
          <Find />
          </TabBar.Item>
          <TabBar.Item
            title="我的"
            key="mine"
            icon={require('./img/cry.png')}
            selectedIcon={require('./img/Smile.png')}
            selected={this.state.selectedTab === '我的'}
            onPress={() => {
              this.setState({
                selectedTab: '我的',
              });
            }}
          >
          <Mine />
          </TabBar.Item>
        </TabBar>
      </View>
    );
  }
}